package com.wzy.web.pojo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

/**
 * PmUser entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "pm_user", catalog = "saozhe")
public class PmUser implements java.io.Serializable {

	// Fields

	private Integer userId;
	private String userName;
	private String userPass;
	
	private String userTelphoto;
	private String userMobeilPhoto;
	private String userImageUrl;
	private String userEmail;
	
	private String userPartment;
	private String userSex;
	private String dateTime;
	private Set<PmAffix> pmAffixes = new HashSet<PmAffix>(0);
	private Set<PmDeledate> pmDeledatesForProjectleaderId = new HashSet<PmDeledate>(0);
	private Set<PmLeader> pmLeaders = new HashSet<PmLeader>(0);
	private Set<PmDeledate> pmDeledatesForProjectDeledateId = new HashSet<PmDeledate>(0);
	private Set<PmArticle> pmArticles = new HashSet<PmArticle>(0);
	private Set<PmActor> pmActors = new HashSet<PmActor>(0);

	// Constructors

	/** default constructor */
	public PmUser() {
	}

	/** minimal constructor */
	public PmUser(String userName, String userPass, String userSex,
			String dateTime) {
		this.userName = userName;
		this.userPass = userPass;
		this.userSex = userSex;
		this.dateTime = dateTime;
	}

	/** full constructor */
	public PmUser(String userName, String userPass, String userPartment,
			String userSex, String dateTime, Set<PmAffix> pmAffixes,
			Set<PmDeledate> pmDeledatesForProjectleaderId,
			Set<PmLeader> pmLeaders,
			Set<PmDeledate> pmDeledatesForProjectDeledateId,
			Set<PmArticle> pmArticles, Set<PmActor> pmActors) {
		this.userName = userName;
		this.userPass = userPass;
		this.userPartment = userPartment;
		this.userSex = userSex;
		this.dateTime = dateTime;
		this.pmAffixes = pmAffixes;
		this.pmDeledatesForProjectleaderId = pmDeledatesForProjectleaderId;
		this.pmLeaders = pmLeaders;
		this.pmDeledatesForProjectDeledateId = pmDeledatesForProjectDeledateId;
		this.pmArticles = pmArticles;
		this.pmActors = pmActors;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "userId", unique = true, nullable = false)
	public Integer getUserId() {
		return this.userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	@Column(name = "userName", nullable = false, length = 30)
	public String getUserName() {
		return this.userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@Column(name = "userPass", nullable = false, length = 30)
	public String getUserPass() {
		return this.userPass;
	}

	public void setUserPass(String userPass) {
		this.userPass = userPass;
	}
	@Column(name = "userTelphoto", nullable = true, length = 30)
	public String getUserTelphoto() {
		return userTelphoto;
	}

	public void setUserTelphoto(String userTelphoto) {
		this.userTelphoto = userTelphoto;
	}
	@Column(name = "userMobeilPhoto", nullable = true, length = 30)
	public String getUserMobeilPhoto() {
		return userMobeilPhoto;
	}

	public void setUserMobeilPhoto(String userMobeilPhoto) {
		this.userMobeilPhoto = userMobeilPhoto;
	}
	@Column(name = "userImageUrl", nullable = true, length = 300)
	public String getUserImageUrl() {
		return userImageUrl;
	}

	public void setUserImageUrl(String userImageUrl) {
		this.userImageUrl = userImageUrl;
	}
	@Column(name = "userEmail", nullable = true, length = 100)
	public String getUserEmail() {
		return userEmail;
	}

	public void setUserEmail(String userEmail) {
		this.userEmail = userEmail;
	}
	@Column(name = "userPartment", length = 50)
	public String getUserPartment() {
		return this.userPartment;
	}

	public void setUserPartment(String userPartment) {
		this.userPartment = userPartment;
	}

	@Column(name = "userSex", nullable = false, length = 4)
	public String getUserSex() {
		return this.userSex;
	}

	public void setUserSex(String userSex) {
		this.userSex = userSex;
	}

	@Column(name = "dateTime", nullable = false, length = 20)
	public String getDateTime() {
		return this.dateTime;
	}

	public void setDateTime(String dateTime) {
		this.dateTime = dateTime;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "pmUser")
	public Set<PmAffix> getPmAffixes() {
		return this.pmAffixes;
	}

	public void setPmAffixes(Set<PmAffix> pmAffixes) {
		this.pmAffixes = pmAffixes;
	}

	@OneToMany(cascade = CascadeType.REFRESH, fetch = FetchType.EAGER, mappedBy = "pmUserByProjectleaderId")
	public Set<PmDeledate> getPmDeledatesForProjectleaderId() {
		return this.pmDeledatesForProjectleaderId;
	}

	public void setPmDeledatesForProjectleaderId(
			Set<PmDeledate> pmDeledatesForProjectleaderId) {
		this.pmDeledatesForProjectleaderId = pmDeledatesForProjectleaderId;
	}

	@OneToMany(cascade = CascadeType.REFRESH, fetch = FetchType.EAGER, mappedBy = "pmUser")
	public Set<PmLeader> getPmLeaders() {
		return this.pmLeaders;
	}

	public void setPmLeaders(Set<PmLeader> pmLeaders) {
		this.pmLeaders = pmLeaders;
	}

	@OneToMany(cascade = CascadeType.REFRESH, fetch = FetchType.EAGER, mappedBy = "pmUserByProjectDeledateId")
	public Set<PmDeledate> getPmDeledatesForProjectDeledateId() {
		return this.pmDeledatesForProjectDeledateId;
	}

	public void setPmDeledatesForProjectDeledateId(
			Set<PmDeledate> pmDeledatesForProjectDeledateId) {
		this.pmDeledatesForProjectDeledateId = pmDeledatesForProjectDeledateId;
	}

	@OneToMany(cascade = CascadeType.REFRESH, fetch = FetchType.EAGER, mappedBy = "pmUser")
	public Set<PmArticle> getPmArticles() {
		return this.pmArticles;
	}

	public void setPmArticles(Set<PmArticle> pmArticles) {
		this.pmArticles = pmArticles;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "pmUser")
	public Set<PmActor> getPmActors() {
		return this.pmActors;
	}

	public void setPmActors(Set<PmActor> pmActors) {
		this.pmActors = pmActors;
	}

}